package com.autosalon.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="STAV_OBJEDNAVKY")
public class StavObjednavky implements Serializable{
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	@Column(name="NAZEV_STAVU", nullable=false, length=50)
	private String stav;
	
	@Column(name="DESCRIPTION", nullable=true, length=500)
	private String description;
	
	@OneToMany(cascade=CascadeType.ALL)
	@JoinColumn(name="ID_STAVU_OBJEDNAVKY")
	private List<Objednavka> objednavky;

	public Long getId() {
		return id;
	}

	public String getStav() {
		return stav;
	}

	public void setStav(String stav) {
		this.stav = stav;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List<Objednavka> getObjednavky() {
		return objednavky;
	}

	public void setObjednavky(List<Objednavka> objednavky) {
		this.objednavky = objednavky;
	}

        @Override
        public String toString() {
            return stav;
        }
	

}
